﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PlaceOrder_Shared.Models.Trade
{
    public class BidHistory:UINotifyPropertyChanged
    {
        public enum enumBidType
        {
            Bid,
            Ofr
        }
        public BidHistory(BidHistory b)
        {
            TsCode = b.TsCode;
            BidType = b.BidType;
            BrokerId = b.BrokerId;
            Volume = b.Volume;
            Price = b.Price;
            UpdateTime = b.UpdateTime;
            UpdateDateTime = b.UpdateDateTime;
            BargainFlag = b.BargainFlag;
            VolumeComment = b.VolumeComment;
            LastTransaction = b.LastTransaction;
            TotalVolume = b.TotalVolume;
            BrokerName = b.BrokerName;
            Date = b.Date;
            NetPrice = b.NetPrice;
            Forward = b.Forward;
            BidID = b.BidID;
        }
        public BidHistory()
        {

        }
        public string TsCode { get; set; } = "";
        public enumBidType BidType { get; set; }
        public int BrokerId { get; set; }
        public string Volume { get; set; } = "";
        public decimal Price { get; set; }
        public string UpdateTime { get; set; } = "";
        public DateTime UpdateDateTime { get; set; }
        public int BargainFlag { get; set; }
        public string VolumeComment { get; set; } = "";
        public decimal LastTransaction { get; set; }
        public int TotalVolume { get; set; }
        public string BrokerName { get; set; } = "";
        public DateOnly Date { get; set; }
        public decimal NetPrice { get; set; }
        public bool Forward { get; set; }
        public int ID { get; set; }
        public string BidID { get; set; }



        /// <summary>
        /// 标记是否有选中的中介
        /// </summary>
        private bool isBrokerSelected =false;

        public bool IsBrokerSelected
        {
            get { return isBrokerSelected; }
            set { isBrokerSelected = value;OnPropertyChanged(); }
        }


        /// <summary>
        /// 标记是否有被占用的中介,true-暗淡，false-高亮
        /// </summary>
        private bool isBrokerOccupied = false;

        public bool IsBrokerOccupied
        {
            get { return isBrokerOccupied; }
            set { isBrokerOccupied = value; OnPropertyChanged(); }
        }

    }
}
